<template>
  <div id="app">
    <ul id="nav" v-show="show">
      <router-link to="/home" tag="li">
        <i class="iconfont icon-fangzi"></i>
        <p>首页</p>
      </router-link>
      <router-link to="/Typeof" tag="li">
        <i class="iconfont icon-leimupinleifenleileibie2-fuben"></i>
        <p>分类</p>
      </router-link>
      <router-link to="/Shopcar" tag="li">
        <i class="iconfont icon-gouwuche"></i>
        <p>购物车</p>
      </router-link>
      <router-link to="/my" tag="li">
        <i class="iconfont icon-tubiaozhizuomoban"></i>
        <p>个人</p>
      </router-link>
    </ul>
    <router-view />
  </div>
</template>
<script>
export default {
  data() {
    return {
      show: true,
    };
  },
  watch: {
    $route: {
      handler(newval, oldval) {
        if (
          newval.path == "/Sign" ||
          newval.path == "/Whole" ||
          newval.path == "/Special" ||
          newval.path == "/Hits" ||
          newval.path == "/gotospecialdetail" ||
          newval.path == "/logindetail" ||
          newval.path == "/orderdetail" ||
          newval.path == "/wholedetail" ||
          newval.path == "/hitsdetail"
        ) {
          this.show = false;
        } else {
          this.show = true;
        }
      },
      immediate: true,
    },
  },
};
</script>
<style lang="scss">
* {
  margin: 0;
  padding: 0;
}
body,
html,
#app {
  width: 100%;
  height: 100%;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#nav {
  list-style: none;
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10vh;
  font-size: 0.35rem;
  border-top: 1px solid #cccccc;
  text-align: center;
  align-items: center;
  background: white;
  z-index: 99999999;
  i {
    font-size: 0.5rem;
  }
}
.router-link-active {
  color: red !important;
}
</style>
